package com.yun.zf.system.service;

import cn.hutool.core.lang.tree.Tree;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yun.zf.common.app.domain.ZfCity;
import com.yun.zf.common.app.dto.home.OpenCityDto;
import com.yun.zf.common.utils.TreeNodes;
import org.springframework.cache.annotation.Cacheable;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 城市区域表 服务类
 * </p>
 *
 * @author cj
 * @since 2021-01-29
 */
public interface ZfCityService extends IService<ZfCity> {

    public   List<TreeNodes> getDistrict(Long cityCode);

    @Cacheable(value = "getCity" ,key = "#cityCode")
    public  ZfCity getCity(Long cityCode);

    public List<ZfCity> getIsOpenCity();


    public List<Long> getCode(String level);


    public List<ZfCity> getCity(String level);


    /**
     * 小程序首页城市列表
     * @return
     */
    @Cacheable(value = "getOpenCity")
    public Map<String, List<OpenCityDto>> getOpenCity();

    @Cacheable(value = "getHotCity" )
    public List<OpenCityDto> getHotCity();

    /**
     * 后台管理开通城市
     * @return
     */
    @Cacheable(value = "managerOpenCity")
    public List<Tree<String>>  managerOpenCity();
}
